<template>
  <v-form v-model="form" @submit.prevent="submitComment">
    <v-textarea
      v-model="commentForm.content"
      label="评论内容"
      required
      variant="outlined"
      rows="3"
      class="mb-4"
    ></v-textarea>
    <v-btn type="submit" color="primary" block>提交评论</v-btn>
  </v-form>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const commentForm = ref({
  content: ''
})

const submitComment = async () => {
  if (commentForm.value.valid) {
    // 提交评论逻辑
    console.log('提交评论:', commentForm.value)
    // 清空评论内容
    commentForm.value.content = ''
  }
}
</script>
